package com.ruoyi.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class MemberRechargeConstants {
    /**
     * 录入方式枚举
     */
    @AllArgsConstructor
    @Getter
    public enum TypeEnum {
        //系统录入
        SYSTEM_INSERT(0),
        //人工录入
        HAND_INSERT(1),
        ;
        private int value;
    }

    /**
     * 变动类型枚举
     */
    @AllArgsConstructor
    @Getter
    public enum ChangeTypeEnum {
        //增加
        INCREASE(0),
        //减少
        DECREASE(1),
        ;
        private int value;
    }

    /**
     * 关联模块枚举
     */
    @AllArgsConstructor
    @Getter
    public enum LinkModelEnum {
        RECHARGE(1,"会员充值"){
            @Override
            public String getLogo(){
                return "https://glht.xrmwl.com/img/recharge.png";
            }
        },
        PAY(2,"加油支付"){
            @Override
            public String getLogo(){
                return "https://glht.xrmwl.com/img/pay.png";
            }
        },
        REFUND(3,"加油支付退款"){
            @Override
            public String getLogo(){
                return "https://glht.xrmwl.com/img/refund.png";
            }
        },
        ORDER_REFUND(4,"会员充值退款"){
            @Override
            public String getLogo(){
                return "https://glht.xrmwl.com/img/refund.png";
            }
        },
        SYSTEM_RECHARGE(5,"后台赠送"){
            @Override
            public String getLogo(){
                return "https://xrmwl.com/glht/profile/notice/cover/0/2022/06/18/ad1b1c3cbabde50a85f8da83c9c7b614.png";
            }
        },
        SYSTEM_DEDUCT(6,"系统扣费"){
            @Override
            public String getLogo(){
                return "https://xrmwl.com/glht/profile/notice/cover/0/2022/06/18/ad1b1c3cbabde50a85f8da83c9c7b614.png";
            }
        },
        SYSTEM_REWARD(7,"佣金入账"){
            @Override
            public String getLogo(){
                return "";
            }
        },
        OTHER(0,"其他"){
            @Override
            public String getLogo(){
                return "https://xrmwl.com/glht/profile/notice/cover/0/2022/06/18/ad1b1c3cbabde50a85f8da83c9c7b614.png";
            }
        }
        ;
        private int value;
        private String valueDesc;

        public abstract String getLogo();

        public static LinkModelEnum match(int value) {
            for (LinkModelEnum one : LinkModelEnum.values()) {
                if (one.getValue() == value) {
                    return one;
                }
            }
            return LinkModelEnum.OTHER;
        }
    }
}
